package com.example.fitnessapp.controller;

import com.example.fitnessapp.util.ApiResponse;
import com.example.fitnessapp.dto.*;
import com.example.fitnessapp.entity.*;
import com.example.fitnessapp.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@RestController
@RequestMapping("/api/user")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @PostMapping("/register")
    public ApiResponse<Map<String, String>> register(@RequestBody RegisterDTO dto) {
        // Simplified logic
        Map<String, String> body = new HashMap<>();
        body.put("userId", UUID.randomUUID().toString());
        return ApiResponse.ok("注册成功", body);
    }

    @PostMapping("/login")
    public ApiResponse<Map<String, String>> login(@RequestBody LoginDTO dto) {
        Map<String, String> body = new HashMap<>();
        body.put("userId", "10001");
        body.put("token", UUID.randomUUID().toString());
        return ApiResponse.ok("登录成功", body);
    }
}
